<template>
  <van-cell-group class="article_item">
    <van-cell>
      <!-- 自定义标题 -->
      <div slot="title">{{ article.title }}</div>
      <!-- 自定义标题下面的内容 -->
      <div slot="label">
        <!-- 三张图片 -->
        <div class="imgs_cover" v-if="article.cover.type === 3">
          <van-image
            :key="index"
            v-for="(item, index) in article.cover.images"
            fit="contain"
            :src="item"
          />
        </div>
        <div class="baseInfo">
          <span>{{ article.aut_name }}</span>
          <span>{{ article.comm_count }}</span>
          <span>{{ article.pubdate | dateFormat}}</span>
        </div>
      </div>
      <!-- 自定义右侧内容 -->
      <van-image
        class="img_cover"
        v-if="article.cover.type === 1"
        fit="contain"
        :src="article.cover.images[0]"
      />
    </van-cell>
  </van-cell-group>
</template>

<script>
export default {
  name: 'articleItem',
  props: {
    article: {
      type: Object,
      required: true
    }
  },
  data () {
    return {

    }
  },

  created () {

  },

  methods: {

  }
}
</script>

<style scoped lang='less'>
.article_item {
  // 右侧
  .van-cell__value {
    flex: unset;
    margin-left: 10px;
  }
  // 1张封面
  .img_cover {
    width: 232px;
    height: 146px;
  }
  .baseInfo {
    span {
      margin-right: 8px;
    }
  }
  // 3张封面
  .imgs_cover {
    display: flex;
    justify-content: space-between;
    margin: 15px 0;
    .van-image {
      width: 232px;
      height: 146px;
    }
    .van-image:nth-child(2) {
      margin: 0 10px;
    }
  }
}
</style>
